package com.jed.xxh.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Switch;

import com.jed.xxh.R;
import com.jed.xxh.utils.ShareUtil;

/**
 * 项目名：stewardAPP<br/>
 * 包名：  com.jed.xxh.ui<br/>
 * 文件名：SettingActivity<br/>
 * 作者：徐晓辉<br/>
 * 创建日期：2018/11/24 14:30<br/>
 * 描述：设置 <br/>
 */
public class SettingActivity extends BaseActivity implements View.OnClickListener {

    private Switch sw_speak;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        initView();
    }

    private void initView() {
        sw_speak = findViewById(R.id.sw_speak);
        sw_speak.setOnClickListener(this);
        Boolean isSpeak = ShareUtil.getBoolean("isSpeak", false);
        sw_speak.setChecked(isSpeak);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.sw_speak:
                sw_speak.setSelected(!sw_speak.isSelected());
                ShareUtil.putBoolean("isSpeak", sw_speak.isChecked());
                break;

        }
    }
}
